<?php // no direct access
defined('_JEXEC') or die('Restricted access');

$chyba = '';
$tydny_arr = $this->tydny_lonsky;
$tydny_obj_list = $tydny_arr['tydny_obj_list'];
$rok_str = $tydny_arr['rok_str'];
$nastaveni_obj = $tydny_arr['nastaveni'];
$nadpis = '';
if (is_object($nastaveni_obj)) {
    $nadpis = $nastaveni_obj->nadpis_hlavni;
}
$chyba = $tydny_arr['chyba'];
echo '<h1>'.$nadpis.' '.$rok_str.'</h1>';
if (empty($chyba)) {
    ?>
<table>
    <form action="index.php" method="post" name="Form">
        <tr>
            <th>
                <select name="tyden_id_int">

                        <?php
                        foreach ($tydny_obj_list as $tyden_obj) {

                            $ode_dne_old = $tyden_obj->ode_dne;
                            $datetime = new DateTime($ode_dne_old);
                            $ode_dne_new = $datetime->format('j. n. Y');
                            $radek_selectu = 'týden od '.$ode_dne_new;
                            echo '<option value="'.$tyden_obj->id.'">'.$radek_selectu;
                        }
                        ?>
                </select>
            </th>
            <td>
                <input type="hidden" name="option" value="com_ohlasky" />
                <input type="hidden" name="task" value="show" />
                <input type="hidden" name="controller" value="tydny" />
                <input type="submit" value="zobrazit">
            </td>
        </tr>
    </form>
</table>
<?php

} else {
echo '<p>'.$chyba.'</p>';
}





